public class MyContactListCntrl {
    public MyContactListCntrl() {
    }
    public Id BookId;
    public List<ContactWrapperCls> contList {get;set;}
    public Set<String> selContactNames {get;set;}
    public List<Id> selContactId {get;set;}
    public List<Contact> ContactIdList {get;set;}
    public Boolean hasSelAcct {get;set;}
    public Id AccId;
    
    public MyContactListCntrl(ApexPages.StandardSetController controller){    
          AccId = ApexPages.currentPage().getParameters().get('Id') ;
          contList = new List<ContactWrapperCls>();
          selContactNames = new Set<String>();
          selContactId  = new List<Id>();
          for(Contact c : [SELECT Name,Id,Email FROM Contact where AccountId =:AccId]){
              contList.add(new ContactWrapperCls(c));
              System.debug('A0000000000' +contList);
            }
       }
   
    // METHODS
     public PageReference displaySelectedContactNumbers(){
        BookId = ApexPages.currentPage().getParameters().get('Id') ; 
         System.Debug('Bookiiiiiiiiiiiii' + BookId);
         PageReference pageRef = new PageReference('/'+BookId);
          selContactNames.clear();
          selContactId .clear();
          hasSelAcct = false;
          for(ContactWrapperCls cWrapper : contList){
               if(cWrapper.isSelected){
                    hasSelAcct = true;
                    selContactNames.add(cWrapper.cContact.Name);
                    selContactId.add(cWrapper.cContact.Id);                                     
              }
          }
      ContactIdList = [Select Name from Contact where Id = :  selContactId];  
      System.debug('BookIdListC----------' + ContactIdList);
       return null;
     }
   
}